Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SECRET support #20

Merged
merged 9 commits into from
Jan 7, 2025
Merged

SECRET support #20

merged 9 commits into from
Jan 7, 2025

Conversation

lmangani
Copy link
Collaborator

@lmangani lmangani commented Dec 29, 2024

Alternative configuration using DuckDB Secrets for #19

Build Instructions

Clone and build the PR branch locally:

cd /usr/src
git clone -b secret-manager --recurse-submodules https://github.com/quackscience/duckdb-extension-openprompt
cd duckdb-extension-openprompt
OVERRIDE_GIT_DESCRIBE="v1.1.3" GEN=ninja make

Run the local DuckDB build:

./build/release/duckdb

Add and test SECRETS

D CREATE PERSISTENT SECRET IF NOT EXISTS open_prompt (
      TYPE open_prompt,
      PROVIDER config,
      api_token 'your-api-token',
      api_url 'http://localhost:11434/v1/chat/completions',
      model_name 'qwen2.5:0.5b',
      api_timeout '30'
  );

D FROM duckdb_secrets();
┌─────────────┬─────────────┬──────────┬────────────┬────────────┬───────────┬───────────────────────────────────────────────────────┐
│    name     │    type     │ provider │ persistent │  storage   │   scope   │                     secret_string                     │
│   varcharvarcharvarcharbooleanvarcharvarchar[] │                        varchar                        │
├─────────────┼─────────────┼──────────┼────────────┼────────────┼───────────┼───────────────────────────────────────────────────────┤
│ open_prompt │ open_prompt │ config   │ true       │ local_file │ []        │ name=open_prompt;type=open_prompt;provider=config;s…  │
└─────────────┴─────────────┴──────────┴────────────┴────────────┴───────────┴───────────────────────────────────────────────────────┘

Testing

The parameters should be derived from ENV or SECRETS instead of SET parameters (in this order)

@lmangani lmangani marked this pull request as ready for review December 29, 2024 14:12
@lmangani lmangani added help wanted Extra attention is needed test wanted labels Dec 29, 2024
@lmangani lmangani changed the title SECRET support WIP: SECRET support Jan 7, 2025
@lmangani lmangani changed the title WIP: SECRET support SECRET support Jan 7, 2025
@lmangani lmangani merged commit c0d634a into main Jan 7, 2025
5 checks passed
@lmangani lmangani deleted the secret-manager branch January 7, 2025 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed test wanted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant